package Object类.equals方法.test04;

public class User {
    String name;
    Address addr;

    public User() {
    }

    public User(String name, Address addr) {
        this.name = name;
        this.addr = addr;
    }
    public boolean equals(Object o){
        if(this == o) return true;
        if(o == null || !(o instanceof User)){
            return false;
        }
        User u = (User)o;
        return name.equals(((User) o).name) && addr.equals(u.addr);
    }
}
